from django.urls import path
from . import views

urlpatterns = [
    # 公共页面
    path('', views.home, name='home'),
    path('movies/', views.movie_list, name='movie_list'),
    path('movie/<int:movie_id>/', views.movie_detail, name='movie_detail'),
    
    # 用户认证
    path('register/', views.register, name='register'),
    path('login/', views.user_login, name='login'),
    path('logout/', views.user_logout, name='logout'),
    
    # 用户功能
    path('profile/', views.profile, name='profile'),
    path('book/<int:screening_id>/', views.book_ticket, name='book_ticket'),
    path('order/<int:order_id>/', views.order_detail, name='order_detail'),
    path('review/<int:movie_id>/', views.add_review, name='add_review'),
    
    # 管理员功能
    path('admin/dashboard/', views.admin_dashboard, name='admin_dashboard'),
    path('admin/movies/', views.movie_management, name='movie_management'),
    path('admin/movies/add/', views.add_movie, name='add_movie'),
    path('admin/movies/edit/<int:movie_id>/', views.edit_movie, name='edit_movie'),
    path('admin/screenings/', views.screening_management, name='screening_management'),
    path('admin/screenings/add/', views.add_screening, name='add_screening'),
    path('admin/orders/', views.order_management, name='order_management'),
    path('admin/users/', views.user_management, name='user_management'),
    path('admin/halls/', views.hall_management, name='hall_management'),
    path('admin/reviews/', views.review_management, name='review_management'),
    
    # API
    path('api/recommendations/', views.get_movie_recommendations, name='get_recommendations'),
    path('api/chat/', views.chat_api, name='chat_api'),
] 